#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>

using namespace std;
class Polynomial{
public:
    Polynomial(int n1):n(n1)
    {}

    void output(){
        cout<< n <<endl;
    }
    vector<double> makepoly(vector<double> a,vector<double> b);
private:
    int n;
    
};
vector<double> Polynomial::makepoly(vector<double> a,vector<double> b){
    vector<vector<double>> c(n+1,vector<double>(20,0));
    c[0]=b;
    //cout << c[0][0] <<endl;
    vector<double> e;
    for (int i=1;i<n+1;i++){
        for (int j=0;j<n+1-i;j++){
            c[i][j]=(c[i-1][j+1]-c[i-1][j])/(a[i+j]-a[j]);

        }
        //cout << c[i][0] <<endl;
    }
    vector<double> res(n+1);
    for (int i=0;i<n+1;i++){
        res[i]=c[i][0];
    }
    return res;
}
